<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app">
    <el-tree :data="aaaa" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</div>

<script type="text/javascript">
    function handleNodeClick(data) {
        console.log(data);
    }
    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!',
            aaaa: [],
            defaultProps: {
                children: 'sons',
                label: 'content'
            }
        },
        // mounted() {
        // },
        methods: {
            // handleNodeClick() {
            // },
            init: function () {
                let that = this;
                this.$nextTick(function () {
                    axios({
                        method: 'get',
                        url: 'http://127.0.0.1:8080/api/blog/comment/1',
                    })
                        .then(function (res) {
                            that.aaaa = res.data
                            console.log(that.aaaa)
                        });
                })
            }
        }
    });
    app.init();
</script>

</body>
</html>